﻿
using ShapeManager;
namespace Commands
{
    public class CommandAdd : ICommand
    {
        DrawObject drawObject;
        public CommandAdd(DrawObject drawObject) : base()
        {
            this.drawObject = drawObject.Clone();
        }
        public void Undo(ShapeList list)
        {
            list.DeleteLastAddedObject();
        }
        public void Redo(ShapeList list)
        {
            list.UnselectAll();
            list.Add(drawObject);
        }
    }
}
